package vn.com.demand.lux.view.labelprovider;

import vn.com.demand.lux.model.WarrantyReservalCaculationlBean;
import vn.com.demand.util.DpUtils;

public class WarrantyReversalCaculationLabelProvider extends BasicLabelProvider {

	public String getColumnText(Object element, int columnIndex) {
		WarrantyReservalCaculationlBean bean = (WarrantyReservalCaculationlBean)element;
		String format = "###,###,###,###.00";
		double value = 0;
		switch (columnIndex) {
		case 0:
			return DpUtils.trim(bean.getContractNumber());
		case 1:
			return DpUtils.trim(bean.getType());
		case 2:
			return DpUtils.trim(bean.getCostCenter());
		case 3:
			value = bean.getAccumulatedWarrantyExpense();
			return value != 0 ? DpUtils.format(value, format) : ""; 
		case 4:
			value = bean.getWarrantyExpense();
			return value != 0 ? DpUtils.format(value, format) : "";
		default:
			break;
		}
		return "";
	}
}
